package com.crayon.graphics.drawDemo
{
	import flash.display.Sprite;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	import flash.text.TextFormat;
	
	public class QuickButton extends Sprite
	{
		public function QuickButton(theText:String = "Test", color:uint = 0x000000):void
		{
			graphics.beginFill(0xCCCCCC);
			graphics.drawRect(0, 0, 100, 30);
			var tf:TextField = new TextField();
			tf.y = 5;
			tf.text = theText;
			tf.autoSize = TextFieldAutoSize.CENTER;
			var format:TextFormat = new TextFormat();
			format.color = color;
			format.size = 12;
			tf.defaultTextFormat = format;
			tf.selectable = false;
			addChild(tf);
			this.buttonMode = true;
			this.mouseChildren = false;
		}
	}
}

